# include "myHeader.h"

void main(){
	//Initlizing the Path
	char path[50] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '} ;
	//Pointer to where hare is at any given time - setting to begining of path
	char *Hare = path;
	//Pointer to where Turtoise is at any given time - setting to begining of path
	char *Turtoise = path;
	
	//Setting where the rocks are...
	path[3] = 'R';  path[8] = 'R';  path[17] = 'R'; path[22] = 'R';
	path[25] = 'R'; path[28] = 'R'; path[40] = 'R'; path[43] = 'R';
	path[47] = 'R';
	//Setting where the streams are...
	path[11] = 'S'; path[12] = 'S'; path[13] = 'S'; path[31] = 'S';
	path[32] = 'S'; path[33] = 'S'; path[34] = 'S'; path[35] = 'S';

	//Introuductory to program
	printf("Welcome to the Hare vs Turtoise Race \n");
	
	//Seeding a random no. to time so random no. are truly random
	srand( (unsigned int)time( NULL ) );
	
	//This causes program to run while Turtoise and Hare have not reached the end of path
	while((Hare < (path + 49) )&& (Turtoise < (path + 49)))
	{
		//Function called to see how many spaces hare moves
		moveHare(path, &Hare);
		//Function called to see how many spaces turtoise moves
		moveTurtoise(path, &Turtoise, Hare);
		//Printing output of path after hare turtoise move each turn
		printOutput(path, Hare, Turtoise);
	}
	//Function to print who won the race.
	printWin(path,Hare,Turtoise);
}